<script type="text/javascript">
        $(function(){
            var pro_li = $(".book_presell .list_aa").find("li");
        

 if(!pro_li||pro_li.length<2){
 $(".book_presell .btn_brand_prev").hide();
$(".book_presell .btn_brand_next").hide();
}

$('.book_presell .mix_marquee_tab').css({"left":(238-(pro_li.length*20-10))/2+"px"});
        })
</script>

//选项卡
<script type="text/javascript">
	$(function(){
		//获取所有的li节点添加点击事件
		$("#dujiaa li").mouseover(function(){
			//获取点击的是第几个li节点
			var m = $(this).index();
			//隐藏所有选项卡
			$("#dujiab>div").css("display","none");
			//显示当前的
			$("#dujiab>div").eq(m).css("display","block");
			//移除所有li的class属性
			$("#dujiaa>li").removeClass("on");
			//当前li添加属性
			$(this).addClass("on");
		});
	});
</script>

//左侧分类
<script>
$('.level_one').each(function(){
if($(this).height() > $(this).find('.submenu').height() + 23){
$(this).find('.submenu').height($(this).height());
}
});
 $('.sidemenu').find('div[father=1]').each(function(){
     var son_len=$(this).find('dl[son=1] dt:empty').length;
     var  sec_cate=$(this).find('.sec_cate:empty').length;
     if(sec_cate>0){$(this).find('.sec_cate').remove();}
     if(son_len>0){
         $(this).remove();
     }else{
         $(this).find('dl[son=1]').find('dt').wrapInner("<span></span>");
         $(this).find('dl[son=1]').find('dd').addClass('dd_level1');
     }
 });
 var fath_len=$('.sidemenu').find('div[father=1]').length-1;
 $('.sidemenu').find('div[father=1]').eq(fath_len).addClass('last');
 $('.eject_left').find('dd>a').each(function(){
     $(this).html("<span>"+$(this).html()+"</span>")
 });
 $('.eject_left').each(function(){
     var dl_len=$(this).find('dl').length-1;
     $(this).find('dl').eq(dl_len).addClass('last');
 });
 $(function(){
     $('.level_one').each(function(e){
         var submenu = $(this).find('.submenu');
         var dl_length=submenu.find('dl').length;
         submenu.hide();
          if(dl_length<1){
             $(this).find('.primary_dl dt span').css('background-image','none');
           }
         $(this).hover(function(){
             if(dl_length>0){
                $(this).addClass('on');
                 $(this).find('.submenu').show();
                 var thisTop = -1;
                 var thisO = $(this), thisSub = thisO.find('.submenu'),thisBody = $('.flq_body');
                 var thisOOffsetT = parseFloat(thisO.offset().top, 10),
                     thisOH = parseFloat(thisO.outerHeight(), 10),
                     thisBodyOffsetT = parseFloat(thisBody.offset().top, 10),
                     thisSubH = parseFloat(thisSub.outerHeight(), 10)

                 var winH = parseFloat($(window).height()),
                     winScrollTop = parseFloat($(window).scrollTop(), 10);

                 if(thisOOffsetT < winScrollTop){
                     thisTop = thisOOffsetT - thisBodyOffsetT - 2;
                 }else{
                     if(winScrollTop - thisBodyOffsetT > thisOOffsetT + thisOH - thisSubH - thisBodyOffsetT - 2){
                         thisTop = winScrollTop - thisBodyOffsetT
                     }else{
                         thisTop = thisOOffsetT + thisOH - thisSubH - thisBodyOffsetT - 2;
                         isIe = 1;
                     }
                 }
                 if(thisTop < -1){
                     thisTop = -1;
                 }
                 thisSub.css({'top': thisTop + "px"})
             }
         },function(){
             $(this).removeClass('on');
             if(dl_length>0){
                 $(this).find('.submenu').hide();
             }
         });
     });
     $('.submenu').each(function(){
         var slen=$(this).find("dl").length;
         if(slen<1){$(this).remove;}
     });
 });
 var c_h = 1063-74-$('.sidemenu').height();

 $('.hotsell').find('.content').css({'height':c_h+'px','overflow':'hidden'});

   $('.level_one').each(function(){
        $(this).find('.primary_dl dd a').last().addClass('last_a');
     });
	 </script>
	 
//左侧分类end
<script>
$(function(){

$('.img').live('mouseenter',function(){ $(this).parent('li').find(".name a").attr("style","text-decoration: underline;color: #ec7814");});

$('.img').live('mouseleave',function(){  $(this).parent('li').find(".name a").attr("style"," ");});


})
</script>

<script>
    var setTo = null;
    function showghotsearch(){
        clearTimeout(setTo);
        document.getElementById("hot_search_content").style.display="block";
    }
    function hidehotsearch(){
        setTo = setTimeout(function(){
          document.getElementById("hot_search_content").style.display="none";
        },100)                        
    }
</script>

//轮播图
   <script type="text/javascript">
            
            var mytime = null;
            var m=1;
            
            function doStart(){
                if(mytime==null){
                    mytime = setInterval(function(){
                        m++;
                        show(m);
                        if(m>={{$lunboimgnum}}){
                            m = 0;
                        }
                    },3000);
                
                }
            }
            
            doStart();
            
            function doStop(){
                if(mytime != null){
                    clearInterval(mytime);
                    mytime = null;
                }
            }
            
            //显示指定图片
            function show(x){
                for(var i=1;i<={{$lunboimgnum}};i++){
                    var img = document.getElementById('m'+i);
					var shuzi = document.getElementById('d'+i);
                    if(i==x){
                        img.style.display = "block";
						shuzi.style.backgroundColor = "blue";
                    }else{
                        img.style.display = "none";
						shuzi.style.backgroundColor = "white";
                    }
                }
            }
        </script>